﻿using QLKS10_11.GUI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QLKS10_11
{
    public partial class form_main : Form
    {
        public form_main()
        {
            InitializeComponent();
        }
        //*************************************************//
        private static form_main _instance;
        public static form_main Instance()
        {
            if (_instance == null)
                _instance = new form_main();
            return _instance;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            form_phong frm2 = form_phong.Instance();
            frm2.Show();
            this.Hide();
        }

        private void btn_thietbi_Click(object sender, EventArgs e)
        {
            form_Thietbi frm3 = form_Thietbi.Instance();
            frm3.Show();
            this.Hide();
        }

        private void btn_qlthietbi_Click(object sender, EventArgs e)
        {
            form_QLthietbi frm4 = form_QLthietbi.Instance();
            frm4.Show();
            this.Hide();
        }

        private void btn_qlthuephong_Click(object sender, EventArgs e)
        {
            form_QLthuephong frm5 = form_QLthuephong.Instance();
            frm5.Show();
            this.Hide();
        }
         form_DN_taikhoan frm_dn = new form_DN_taikhoan();
        private void btn_dangnhaptaikhoan_Click(object sender, EventArgs e)
        {
            if (frm_dn == null || frm_dn.IsDisposed == true)
            {

               
                frm_dn.MdiParent = this;
                frm_dn.Show();
                this.Hide();
               // i = 1;

            }
        }
      //  form_DN_taikhoan frm6 = new form_DN_taikhoan();
       /// private void form_main_Load(object sender, EventArgs e)
        //{
         //   if(frm6.Show==DialogResult.OK)
        //}

        private void btn_thoat_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Ban co muon thoat khong ?", "Thong bao", MessageBoxButtons.YesNo) == DialogResult.Yes)
            { 
               this.Close();
            }
        }

        private void btn_qldatphong_Click(object sender, EventArgs e)
        {
            form_QLdatphong frm6 = form_QLdatphong.Instance();
            frm6.Show();
            this.Hide();
        }
        //*************************************************//
    }
}
